#ifndef SCHEDULEDIALOG_H
#define SCHEDULEDIALOG_H

#include <QDialog>
#include <QTcpServer>
#include <QVector>
#include "client.h"
#include "scheduleconflicts.h"
#include "schedulepopulation.h"

namespace Ui {
class ScheduleDialog;
}

class ScheduleDialog : public QDialog {
    Q_OBJECT
public:
    ScheduleDialog(QWidget *parent = 0);
    ~ScheduleDialog();
    QString packPopulation(SchedulePopulation*);
    QString packConflicts();
    SchedulePopulation* unpackPopulation(QString);

protected:
    void changeEvent(QEvent *e);

private:
    Ui::ScheduleDialog *ui;
    QTcpServer* server;
    QVector<Client*> clients;
    QVector<QString> responses;
    //population
    int populationSize;
    double fitnessThreshold;
    int timeSlots;
    //scheduleconflict
    int numClasses;
    double difficulty;
    ScheduleConflicts* sc;

private slots:
    void on_StartServerBtn_clicked();
    void connectClient();
    void on_SendMsgBtn_clicked();
    void getData(QString);
};

#endif // SCHEDULEDIALOG_H
